%define         _root_sbindir /sbin

Name:           fuse-exfat
Summary:        Free exFAT file system implementation
Version:        1.0.1
Release:        10%{?dist}
License:        GPLv3+
Group:          System/Base
Source0:        http://exfat.googlecode.com/files/fuse-exfat-%{version}.tar.gz
URL:            http://code.google.com/p/exfat/
BuildRequires:  fuse-devel
BuildRequires:  scons

%description
This driver is the first free exFAT file system implementation with write
support. exFAT is a simple file system created by Microsoft. It is intended
to replace FAT32 removing some of it's limitations. exFAT is a standard FS
for SDXC memory cards.

%prep
%setup -q

%build
scons CFLAGS="%{optflags}"

%install
scons install DESTDIR=%{buildroot}%{_root_sbindir}

%post
if ! grep -qe '^exfat$' /etc/filesystems ; then
  echo "exfat" >> /etc/filesystems
fi

if ! grep -qe '^exfat_fuse$' /etc/filesystems ; then
  echo "exfat_fuse" >> /etc/filesystems
fi
 
%postun
if [ "$1" == "0" ]; then
  sed -i -e '/^exfat_fuse$/d' -e '/^exfat$/d' /etc/filesystems
fi

%files
%defattr(0644,root,root)
%doc COPYING
%attr(0755,root,root) %{_root_sbindir}/mount.exfat-fuse
%{_root_sbindir}/mount.exfat

%changelog
* Sat Jan 11 2014 Patrick C. F. Ernzer <exfat.spec@pcfe.net> - 1.0.1-10
- moved the mount binaries to /sbin
- adjusted Release to expected revision number at checkin
- added changing /etc/filesystems as per https://build.opensuse.org/package/rdiff/home:ZaWertun:exfat/fuse-exfat?linkrev=base&rev=15
- added attribution for initial spec file

* Fri Jan 03 2014 Patrick C. F. Ernzer <exfat.spec@pcfe.net> - 1.0.1-2
- removed man pages
- set file attributes

* Sun Mar 17 2013 TingPing <tingping@tingping.se> - 1.0.1-1
- Initial package based on SRPM from rpmfusion

